package top.healthylife.gateway.platformchain.api.black.business.remove;

import cn.hutool.core.bean.BeanUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import top.healthylife.gateway.core.service.ParentFace;
import top.healthylife.gateway.core.util.SystemConfigUtils;
import top.healthylife.gateway.dto.annotation.ApiServiceExplain;
import top.healthylife.gateway.platform.chain.dto.business.remove.req.ChainBusinessBlackListRemoveReqDto;
import top.healthylife.gateway.platform.chain.dto.business.remove.res.ChainBusinessBlackListRemoveResDto;
import top.healthylife.gateway.platformchain.api.config.SystemConfig;
import top.healthylife.gateway.platformchain.api.util.OutHttpUtil;

/**
 * @author : GaoZeXi
 * @date 2021/5/7 17:54
 */
@Slf4j
@Service
@ApiServiceExplain(price = 20, apiName = "企业黑名单-移除", info = "移除企业黑名单数据")
public class BusinessBlackListRemoveApi implements ParentFace<ChainBusinessBlackListRemoveReqDto, ChainBusinessBlackListRemoveResDto> {
    private static final String URL = OutHttpUtil.BASE_URL+"/bcapi/api/blacklist/removeEnterprise";
    @Override
    public ChainBusinessBlackListRemoveResDto execute(ChainBusinessBlackListRemoveReqDto reqDto) {

        return OutHttpUtil.post(URL, BeanUtil.beanToMap(reqDto), (SystemConfig) SystemConfigUtils.get()
                , ChainBusinessBlackListRemoveResDto.class);
    }
}
